package com.hj.springmybatis.advice;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Aspect     //aop注解
@Order(2)     //优先级
public class AopAdvice {
    @Before("execution(* com..springmybatis.service.*.*(..))")

    public void before(JoinPoint joinPoint) {
        String className = joinPoint.getTarget().getClass().getName();
        String methodName = joinPoint.getSignature().getName();
        System.out.println(className + "." + methodName+"执行了");
    }
}
